/**
 * @/stores/userStore.js
 * 全局用户状态
 */

import { defineStore } from "pinia";

/* 创建管理状态 */
export const useUserStore = defineStore("user", {
  /* 定义状态数据 */
  state: () => ({
    currentUser: {
      username: "游客",
      role: "notLoginUser",
    },
  }),
  /* 定义状态方法 */
  actions: {
    setCurrentUser(currentUser) {
      this.currentUser = currentUser;
    },
  },
});
